package org.agile.calculator;

import static org.junit.Assert.*;

import org.junit.Test;

public class CalculatorTestCase {

	@Test
	public void addingTwoPositiveNaturalNumbersReturnTheSumOfBoth() throws Exception {
		assertEquals(2, Calculator.add(1, 1));
		assertEquals(3, Calculator.add(1, 2));
	}
	
	@Test(expected = IllegalArgumentException.class)
	public void throwsExceptionWhenAnArgumentIsNegativeNumber() throws Exception {
		Calculator.add(-1, 2);
		Calculator.add(2, -3);
	}
	
	@Test
	public void substractingTwoPositiveNaturalNumbersReturnTheRestOfBoth() throws Exception {
		assertEquals(3, Calculator.substract(5, 2));
		assertEquals(-2, Calculator.substract(4, 6));
	}
	
}
